package com.tianyuan.rest;

import com.tianyuan.pojo.Type;
import com.tianyuan.service.TypeService;
import me.zhengjie.annotation.AnonymousAccess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @program: eladmin
 * @description: 类型控制器
 * @author: Mr.Wang
 * @create: 2020-10-21 11:06
 **/
@Controller
@RequestMapping("/api")
public class TypeController {

    @Autowired
    private TypeService typeService;

    @AnonymousAccess  //接口方行
    @RequestMapping("/type")
    @ResponseBody
    public List<Type> queryAll(){
        return typeService.queryAll();
    }
}
